﻿#ifndef BASEMODULE_IBASESIGNAL_H
#define BASEMODULE_IBASESIGNAL_H

#include <QObject>
#include <QString>
#include "API_BaseModule.h"

#define IBaseSignalInstance BaseModule::IBaseSignal::getInstance()

namespace BaseModule
{
    class API_BASEMODULE IBaseSignal : public QObject
    {
        Q_OBJECT
    public:
        static IBaseSignal* getInstance()
        {
            static IBaseSignal m_instance;
            return &m_instance;
        }

    signals:
        void signal_sendErrorMessageToUI(const QString& message);
        void signal_sendQuestionMessageToUI(int& result, const QString& title, const QString& message);

        /// @brief 准备关闭程序
        /// @param isClose 是否允许关闭. true允许，false禁止
        void signal_readyCloseApp(bool& isClose);

    private:
        IBaseSignal(const IBaseSignal&) = delete;
        IBaseSignal& operator=(const IBaseSignal&) = delete;
        IBaseSignal() = default;
    };

}

#endif
